<template>
	<view class="list">
	<view class="idea" >
		<view class="idea-list" v-for="(item,index) in feedbackList" :key="index">
			<view class="idea-wrapper">
				<view class="idea-item">
					<view class="idea-text">{{item.message}}</view>
					<view class="idea-time">{{item.created}}</view>
					<text class="idea-solve" style="color: #969993;">
					</text>
					
				</view>
			</view>
			<view class="idea-wrapper" v-if="item.reply" style="border-top: 1px solid rgba(229, 235, 241, 1);">
				<view class="idea-item">
					<view style="color:#3E9AFC;font-size: 14px;">回复内容</view>
					<view class="idea-text">{{item.reply}}</view>
					<!-- <view class="idea-time">{{item.reply.created}}</view> -->
				</view>
			</view>
		</view>
		
		<view v-if="loadAll&&feedbackList.length>=10" class="no-more-data">没有更多了</view>
		<view v-if="feedbackList.length == 0" class="no-more-data">
		  暂无数据
		</view>
	</view>
	<!-- <view class="order-none" v-else>
		<image class="order-none-img" src="" mode=""></image>
	</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				 feedbackList:[],
				 loadAll:false,
				 page:1
				}
		},
		onShow() {
			this.getIdeaInfoList()
		},
		onPullDownRefresh() {
		  // console.log('下拉刷新')
		  this.loadAll = false;
		  this.feedbackList = [];
		  this.page = 1;
		  this.getIdeaInfoList();
		},
		onReachBottom() {
		  console.log('上拉加载')
		  if (!this.loadAll) {
		    this.getIdeaInfoList();
		  }
		},
		methods:{
			//反馈列表获取
			getIdeaInfoList () {
				this.$http.feedback_list({page:this.page}).then(res => {
					uni.stopPullDownRefresh()
					if(res.code == 0){
						let _list = res.data.data
						let totalPage = res.data.last_page
						if (this.page > totalPage || _list.length == 0) {
						  this.loadAll = true
						  return
						}
						if(_list.length > 0){
						  this.feedbackList = this.feedbackList.concat(_list);
						}
						this.page++;
					}
				})
			},
		}
	 }
	
</script>

<style>
	.list{
		width: 100%;
		background-color: #fff;
	}
	.idea{
			font-size: 16px;
			background-color: #fff;
		    position: relative;
		    height: 100%;
		    width: 100%;
			padding-bottom: 30px;
	}
	.idea-list{
		background-color: #fff;
		margin: 15px 20px;
		border-radius: 5px;
box-shadow:0px 0px 15px 0px rgba(0,0,0,0.04);
	}
	.idea-time{
	    color: rgba(184, 185, 190, 1);	
		font-size: 12px;
		    text-align: right;
	}
	.idea-wrapper{
		position: relative;
		border-radius: 0 0 5px 5px;
	}
	.idea-text{
		width: 100%;
		color: rgba(77, 77, 77, 1);
		font-size: 12px;
		    padding: 10px 0;
	}
	.idea-item{
		padding: 10px 13px;
		background-color: rgba(187, 187, 187, 0.1);
	}
	.idea-solve{
	    position: absolute;
	    top: 25px;
	    right: 10px;
	    color: #D94600;
	}
	.idea-solve image{
		width: 13px;
		height: 7px;
	}
	.order-none{
		text-align: center;
		padding: 200upx 0;
	}
	.order-none-img{
		width: 274upx;
		height: 274upx;
	}
</style>
